#include "Sales_item.h"

int main(int argc, char *argv[])
{
  Sales_item temp;
  Sales_item origin;
  std::cin >> origin;
  while ( std::cin >> temp ) {
    if (origin.isbn() == temp.isbn()) {
      origin += temp;
    }
  }
  std::cout << origin << std::endl;
  return 0;
}
